package com.cskaoyan.user.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cskaoyan.user.dal.entitys.Member;
import com.cskaoyan.user.dal.entitys.UserVerify;
import com.cskaoyan.user.dal.persistence.MemberMapper;
import com.cskaoyan.user.dal.persistence.UserVerifyMapper;
import com.cskaoyan.user.service.UserVerifyService;

/**
 * @author zyf
 * @since 2022/06/18 14:32
 */
@Service
public class UserVerifyServiceImpl implements UserVerifyService {
    @Autowired
    MemberMapper memberMapper;

    @Autowired
    UserVerifyMapper userVerifyMapper;
    @Override
    public void verify(String uuid,String username) {
        Member member = new Member();
       member.setUsername(username);
        member.setIsVerified("Y");
        memberMapper.updateVerifiedByUserName(username);

        UserVerify userVerify = new UserVerify();
        userVerify.setIsVerify("Y");
        userVerify.setUuid(String.valueOf(uuid));
        userVerifyMapper.updateIsVerifyByUuid(uuid);

    }
}
